<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-btn+.layui-btn{
            margin-left: 0;
        }
        .layui-table td, .layui-table th
        {
            min-width: 50px !important;
        }
    </style>
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>{$nav}</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
    </div>
    <div class="x-body x-admin">
        
      <xblock>
        <div class="layui-card-body" style="padding-left: 0;float:left;padding-left:20px;padding-top:0;">
          <form class="layui-form layui-col-space5" action="" method="get">

          </form>
        </div>
      </xblock>
      <div class="layui-table-body layui-table-main" style="width: 100%;">
      <table class="layui-table layui-form" lay-filter="liveDetail" id="liveDetail">
        <thead>
          <tr>
            <th width="60" lay-data="{field:'id', width:70, sort: true}">编号</th>
            <th lay-data="{field:'add_time', width:100, sort: true}">日期</th>
            <th lay-data="{field:'activity_name', edit: 'text'}">活动名称</th>
            <th lay-data="{field:'activity_date', width:60,edit: 'text'}">营销</th>
            <th lay-data="{field:'activity_time', width:110}">直播具体时间</th>
            <th lay-data="{field:'activity_address', width:180,edit: 'text'}">地点</th>
            <th lay-data="{field:'activity_sponsor_device', width:120,edit: 'text'}">主办方设备情况</th>
            <th lay-data="{field:'activity_need_device', width:120,edit: 'text'}">需求设备情况</th>
            <th lay-data="{field:'activity_price', width:60,edit: 'text'}">价格</th>
            <th lay-data="{field:'note', width:200}">备注</th>
            <th lay-data="{field:'admin_id', width:100}">添加时间</th>
            <th lay-data="{field:'d', width:100}">操作</th>
        </thead>
        <tbody>
          {volist name="list" id="value"}
          <tr>
            <td>{$value.id}</td>
            <td>{$value.activity_start_time|date="Y-m-d",###}</td>
            <td>{$value.activity_name}</td>
            <td>{:idToAdminname($value.admin_id)}</td>
            <td>{$value.activity_start_time|date="H:i",###}-{$value.activity_end_time|date="H:i",###}</td>
            <td>{$value.activity_address}</td>
            <td>{$value.activity_sponsor_device}</td>
            <td>{$value.activity_need_device}</td>
            <td>{$value.price}</td>
            <td>{$value.note}</td>
            <td>{$value.add_time|date="Y-m-d",###}</td>
            <td class="td-manage" style="text-align: center;">
                <a title="修改" class="layui-btn layui-btn-normal layui-btn-xs" onclick="x_admin_show('修改商品','{:url('Goods/GoodsEdit')}/id/{$value.id}','','600','600')" href="javascript:;">修改</a>
                <a title="删除" class="layui-btn layui-btn-danger layui-btn-xs" onclick="member_del(this,{$value.id})" href="javascript:;">删除</a>
            </td>
          </tr>
          {/volist}
        </tbody>
      </table>
    </div>
      <div class="page">
        <div>
           
        </div>
      </div>
    </div>
    <script type="text/html" id="barDemo">
      <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
      <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
      layui.use(['form','layer','jquery','table','util'], function(){
        form = layui.form,
        layer = layui.layer
        ,$ = layui.jquery
        ,table = layui.table
        ,util = layui.util;
        
        
        
        
        
          table.init('liveDetail', { //转化静态表格
            //height: 'full-500',
            escape: true,
          }); 

          
          table.on('edit(liveDetail)', function(obj){
            var value = obj.value 
            ,data = obj.data 
            ,field = obj.field; 
            console.log(obj);
            layer.msg('[ID: '+ data.id +'] ' + field + ' 字段更改值为：'+ util.escape(value));
          });
      });
      function member_del(obj,id){
          layer.confirm('确认要删除吗？',function(index){
              $.ajax({
                type:'POST',
                dataType:'json',
                data:{id:id},
                url:"{:url('goods/goodsDel')}",
                success:function(o){
                  if(o.icon ==1){
                    $(obj).parents("tr").remove();
                  }
                  layer.msg(o.msg,{icon:o.icon,time:1000});
                }
              });
          });
      }
    </script>
  </body>

</html>